<?xml version="1.0" encoding="utf-8" ?>
<!--
    Copyright (c) 2018-2022 Qualcomm Technologies, Inc.
    All Rights Reserved.
    Confidential and Proprietary - Qualcomm Technologies, Inc.

    Not a Contribution.

    Copyright (C) 2012-2017 The Linux Foundation. All rights reserved.
    Copyright (C) 2012-2013 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<MediaCodecs>
    <Decoders>
        <!-- C2 HW decoders -->
        <MediaCodec name="c2.qti.avc.decoder" type="video/avc" update="true">
            <Limit name="measured-frame-rate-320x240" range="566-1246" />
            <Limit name="measured-frame-rate-720x480" range="485-1067" />
            <Limit name="measured-frame-rate-1280x720" range="328-722" />
            <Limit name="measured-frame-rate-1920x1088" range="165-364" />
        </MediaCodec>
        <MediaCodec name="c2.qti.avc.decoder.low_latency" type="video/avc" update="true">
            <Limit name="measured-frame-rate-320x240" range="593-1305" />
            <Limit name="measured-frame-rate-720x480" range="480-1056" />
            <Limit name="measured-frame-rate-1280x720" range="331-729" />
            <Limit name="measured-frame-rate-1920x1080" range="165-364" />
        </MediaCodec>
        <MediaCodec name="c2.qti.hevc.decoder" type="video/hevc" update="true">
            <Limit name="measured-frame-rate-352x288" range="660-1453" />
            <Limit name="measured-frame-rate-720x480" range="587-1292" />
            <Limit name="measured-frame-rate-1280x720" range="399-878" />
            <Limit name="measured-frame-rate-1920x1080" range="318-700" />
            <Limit name="measured-frame-rate-3840x2160" range="83-183" />
        </MediaCodec>
        <MediaCodec name="c2.qti.hevc.decoder.low_latency" type="video/hevc" update="true">
            <Limit name="measured-frame-rate-352x288" range="667-1468" />
            <Limit name="measured-frame-rate-720x480" range="586-1290" />
            <Limit name="measured-frame-rate-1280x720" range="450-991" />
            <Limit name="measured-frame-rate-1920x1080" range="323-711" />
            <Limit name="measured-frame-rate-3840x2160" range="83-183" />
        </MediaCodec>
        <MediaCodec name="c2.qti.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
            <Limit name="measured-frame-rate-320x180" range="474-1043" />
            <Limit name="measured-frame-rate-640x360" range="363-799" />
            <Limit name="measured-frame-rate-1280x720" range="214-471" />
            <Limit name="measured-frame-rate-1920x1080" range="177-390" />
            <Limit name="measured-frame-rate-3840x2160" range="65-143" />
        </MediaCodec>
        <MediaCodec name="c2.qti.vp9.decoder.low_latency" type="video/x-vnd.on2.vp9" update="true">
            <Limit name="measured-frame-rate-320x180" range="445-980" />
            <Limit name="measured-frame-rate-640x360" range="379-834" />
            <Limit name="measured-frame-rate-1280x720" range="214-471" />
            <Limit name="measured-frame-rate-1920x1080" range="177-390" />
            <Limit name="measured-frame-rate-3840x2160" range="67-148" />
        </MediaCodec>

        <!-- C2 SW codecs -->
        <MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
            <!-- measured 98%:153-414 med:193/192 FLAKY(mn=61.7 < 96 - 414 < mx=423.7) -->
            <Limit name="measured-frame-rate-320x240" range="393-865" /> <!-- N=266 v98%=1.6 -->
            <Limit name="measured-frame-rate-720x480" range="177-390" /> <!-- N=266 v98%=1.5 -->
            <Limit name="measured-frame-rate-1280x720" range="71-157" /> <!-- N=236 v98%=1.5 (-PD1A.180712.003) -->
            <Limit name="measured-frame-rate-1920x1080" range="21-47" /> <!-- N=272 v98%=1.4 -->
        </MediaCodec>
        <MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
            <Limit name="measured-frame-rate-352x288" range="419-922" /> <!-- N=270 v98%=1.6 -->
            <!-- measured 98%:77-220 med:165/169 FLAKY(mn=74.9 < 75 - 338) -->
            <Limit name="measured-frame-rate-640x360" range="207-456" /> <!-- TWEAKED N=269 v98%=1.7 -->
            <!-- measured 98%:85-223 med:194/186 FLAKY(mn=80.8 < 85 - 372) -->
            <Limit name="measured-frame-rate-720x480" range="191-421" /> <!-- TWEAKED N=270 v98%=1.6 -->
            <Limit name="measured-frame-rate-1280x720" range="80-176" /> <!-- N=270 v98%=1.4 -->
            <Limit name="measured-frame-rate-1920x1080" range="31-69" /> <!-- N=230 v98%=1.2 (-PD1A.180706.000) -->
        </MediaCodec>
        <MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
            <!-- measured 98%:191-657 med:617/613 FLAKY(mn=183.9 < 191 - 1226) -->
            <Limit name="measured-frame-rate-320x180" range="556-1224" /> <!-- TWEAKED N=270 v98%=1.9 (-PD1A.180717.001) -->
            <Limit name="measured-frame-rate-640x360" range="251-553" /> <!-- N=230 v98%=1.3 -->
            <!-- measured 98%:35-54 med:36/36 N=64 -->
            <Limit name="measured-frame-rate-1280x720" range="72-159" /> <!-- v98%=1.2 (PD1A.180706.000-) -->
            <Limit name="measured-frame-rate-1920x1080" range="27-60" /> <!-- N=270 v98%=1.3 (-PD1A.180717.001) -->
        </MediaCodec>
        <MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
            <!-- measured 98%:173-698 med:670/668 FLAKY(mn=161.4 < 162 - 1336) variance:2.0 -->
            <Limit name="measured-frame-rate-320x180" range="446-982" /> <!-- TWEAKED N=228 -->
            <Limit name="measured-frame-rate-640x360" range="221-487" /> <!-- N=272 v98%=1.9 (-PD1A.180717.001) -->
            <Limit name="measured-frame-rate-1280x720" range="101-223" /> <!-- N=270 v98%=1.3 (-PD1A.180717.001) -->
            <Limit name="measured-frame-rate-1920x1080" range="59-130" /> <!-- N=230 v98%=1.2 -->
        </MediaCodec>
        <MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
            <!-- measured 98%:151-1143 med:437/432 FLAKY(111 - 972 < mx=1146.8) variance:2.8 -->
            <Limit name="measured-frame-rate-176x144" range="930-2047" /> <!-- N=270 -->
            <Limit name="measured-frame-rate-352x288" range="841-1851" /> <!-- N=270 -->
        </MediaCodec>
        <MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
            <!-- measured 90%:149-1332 med:379/360 FLAKY(109 - 958 < mx=1400.6) RG.VARIANCE:2.1 -->
            <Limit name="measured-frame-rate-176x144" range="961-2115" /> <!-- N=272 v90%=3.0 -->
            <Limit name="measured-frame-rate-480x360" range="688-1514" />
            <Limit name="measured-frame-rate-1280x720" range="280-616" />
        </MediaCodec>
    </Decoders>

    <Encoders>
        <!-- C2 HW encoders -->
        <MediaCodec name="c2.qti.avc.encoder" type="video/avc" update="true">
            <Limit name="measured-frame-rate-320x240" range="289-636" />
            <Limit name="measured-frame-rate-720x480" range="216-476" />
            <Limit name="measured-frame-rate-1280x720" range="111-245" />
            <Limit name="measured-frame-rate-1920x1080" range="52-115" />
        </MediaCodec>
        <MediaCodec name="c2.qti.hevc.encoder" type="video/hevc" update="true">
            <Limit name="measured-frame-rate-320x240" range="315-693" />
            <Limit name="measured-frame-rate-720x480" range="264-581" />
            <Limit name="measured-frame-rate-1280x720" range="136-300" />
            <Limit name="measured-frame-rate-1920x1080" range="54-119" />
            <Limit name="measured-frame-rate-3840x2160" range="16-36" />
        </MediaCodec>
        <MediaCodec name="c2.qti.hevc.encoder.cq" type="video/hevc" update="true">
            <Limit name="measured-frame-rate-320x240" range="399-878" />
        </MediaCodec>

        <!-- C2 SW encoders -->
        <MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
            <!-- measured 95%:144-637 med:343/343 FLAKY(mn=40.8 < 144 - 808 < mx=916.6) variance:2.1 -->
            <Limit name="measured-frame-rate-176x144" range="661-1455" /> <!-- TWEAKED N=224 -->
        </MediaCodec>
        <MediaCodec name="c2.android.avc.encoder" type="video/avc" update="true">
            <!-- measured 90%:42-420 med:146/160 FLAKY(mn=39.0 < 42 - 368 < mx=569.5) RG.VARIANCE:2.2 -->
            <Limit name="measured-frame-rate-320x240" range="210-463" /> <!-- SHOULDN'T HAVE TWEAKED N=266 v90%=3.2 -->
            <!-- measured 98%:29-166 med:66/63 FLAKY(24 - 166 < mx=166.5) variance:2.4 -->
            <Limit name="measured-frame-rate-720x480" range="73-161" /> <!-- N=262 -->
            <!-- measured 98%:11-68 med:30/30 FLAKY(mn=10.5 < 11 - 68 < mx=82.1) variance:2.5 -->
            <Limit name="measured-frame-rate-1280x720" range="48-106" /> <!-- TWEAKED N=236 -->
            <!-- measured 98%:10-38 med:18/18 FLAKY(mn=5.2 < 9 - 38 < mx=38.8) -->
            <Limit name="measured-frame-rate-1920x1080" range="25-56" /> <!-- N=288 v98%=2.0 -->
        </MediaCodec>
        <MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
            <!-- measured 90%:29-451 med:208/206 FLAKY(mn=19.2 < 47 - 412 < mx=888.9) RG.VARIANCE:2.5 -->
            <Limit name="measured-frame-rate-176x144" range="630-1386" /> <!-- SHOULDN'T HAVE TWEAKED N=220 v90%=4.0 -->
        </MediaCodec>
        <MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
            <!-- measured 90%:6-36 med:30/29 FLAKY(mn=0.0 < 7 - 58) variance:2.5 -->
            <Limit name="measured-frame-rate-320x180" range="217-478" /> <!-- SHOULDN'T HAVE TWEAKED N=214 -->
            <!-- measured 98%:3-24 med:12/12 FLAKY(mn=2.8 < 3 - 24 < mx=26.6) variance:2.8 -->
            <Limit name="measured-frame-rate-640x360" range="112-247" /> <!-- N=220 -->
            <!-- measured 98%:3-11 med:6/6 FLAKY(mn=0.0 < 3 - 12) -->
            <Limit name="measured-frame-rate-1280x720" range="28-62" /> <!-- N=202 v98%=2.0 -->
            <!-- measured 98%:3-7 med:5/5 FLAKY(mn=0.0 < 2 - 10 < mx=11.2) -->
            <Limit name="measured-frame-rate-1920x1080" range="19-42" /> <!-- N=212 v98%=1.5 -->
        </MediaCodec>
        <MediaCodec name="c2.android.vp9.encoder" type="video/x-vnd.on2.vp9" update="true">
            <!-- measured 93%:99-156 med:109/109 N=24 -->
            <Limit name="measured-frame-rate-320x180" range="116-260" /> <!-- v93%=1.3 -->
            <!-- measured 95%:54-67 med:61/61 N=36 -->
            <Limit name="measured-frame-rate-640x360" range="35-75" /> <!-- v95%=1.1 -->
            <!-- measured 95%:16-26 med:20/20 N=32 -->
            <Limit name="measured-frame-rate-1280x720" range="20-20" /> <!-- v95%=1.3 -->
        </MediaCodec>
        <MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">
             <Limit name="measured-frame-rate-320x240" range="30-66" />
             <Limit name="measured-frame-rate-720x480" range="8-15" />
        </MediaCodec>
    </Encoders>
</MediaCodecs>
